{% block sw_product_basic_form %}
<div class="product-basic-form">
    {% block sw_product_basic_form_title_field %}
    <sw-inherit-wrapper
        v-model:value="product.name"
        :has-parent="!!parentProduct.id"
        :inherited-value="getInheritValue('translated', 'name')"
    >
        <template #content="props">

            <mt-text-field
                :model-value="props.currentValue"
                :is-inheritance-field="props.isInheritField"
                :is-inherited="props.isInherited"
                :disabled="props.isInherited || !allowEdit"
                :label="$tc('sw-product.basicForm.labelTitle')"
                :required="isTitleRequired"
                name="sw-field--product-name"
                :error="productNameError"
                :placeholder="placeholder(product, 'name', $tc('sw-product.basicForm.placeholderName'))"
                @inheritance-restore="props.restoreInheritance"
                @inheritance-remove="props.removeInheritance"
                @update:model-value="props.updateCurrentValue"
            />

        </template>
    </sw-inherit-wrapper>
    {% endblock %}

    <sw-container
        columns="2fr 1fr"
        gap="0px 30px"
    >
        {% block sw_product_basic_form_manufacturer_field %}
        <sw-inherit-wrapper
            v-model:value="product.manufacturerId"
            :has-parent="!!parentProduct.id"
            :inherited-value="parentProduct.manufacturerId"
            :label="$tc('sw-product.basicForm.labelManufacturer')"
        >
            <template #content="{ currentValue, updateCurrentValue, isInherited }">

                <sw-entity-single-select
                    id="manufacturerId"
                    :key="isInherited"
                    :value="currentValue"
                    entity="product_manufacturer"
                    :disabled="isInherited || !allowEdit"
                    class="sw-select-product__select_manufacturer"
                    :error="productManufacturerIdError"
                    :placeholder="$tc('sw-product.basicForm.placeholderManufacturer')"
                    show-clearable-button
                    allow-entity-creation
                    :entity-creation-label="$tc('sw-product.basicForm.labelManufacturerCreation')"
                    @update:value="updateCurrentValue"
                />

            </template>
        </sw-inherit-wrapper>
        {% endblock %}

        {% block sw_product_basic_form_id_field %}

        <mt-text-field
            v-model="product.productNumber"
            :error="productProductNumberError"
            :disabled="!allowEdit"
            :label="$tc('sw-product.basicForm.labelProductNumber')"
            :help-text="productNumberHelpText"
        />
        {% endblock %}
    </sw-container>

    {% block sw_product_basic_form_description_field %}
    <sw-inherit-wrapper
        v-model:value="product.description"
        class="sw-product-basic-form__inheritance-wrapper-description"
        :has-parent="!!parentProduct.id"
        :inherited-value="getInheritValue('translated', 'description')"
        :label="$tc('sw-product.basicForm.labelDescription')"
    >
        <template #content="{ currentValue, updateCurrentValue, isInherited }">
            <mt-text-editor
                :key="isInherited"
                :placeholder="placeholder(product, 'description', $tc('sw-product.basicForm.placeholderDescriptionLong'))"
                :error="productDescriptionError"
                :disabled="isInherited || !allowEdit"
                :model-value="currentValue"
                sanitize-input
                sanitize-field-name="product_translation.description"
                @update:model-value="updateCurrentValue"
            />
        </template>
    </sw-inherit-wrapper>
    {% endblock %}

    <div class="product-basic-form__switches">

        {% block sw_product_settings_form_mark_as_topseller_field %}
        <sw-inherit-wrapper
            v-show="showSettingsInformation"
            v-model:value="product.markAsTopseller"
            class="sw-product-basic-form__promotion-switch"
            :has-parent="!!parentProduct.id"
            :inherited-value="parentProduct.markAsTopseller"
        >
            <template #content="props">

                <mt-switch
                    :error="productMarkAsTopsellerError"
                    :is-inheritance-field="props.isInheritField"
                    :is-inherited="props.isInherited"
                    :help-text="highlightHelpText"
                    :label="$tc('sw-product.settingsForm.labelMarkAsTopseller')"
                    :disabled="props.isInherited || !allowEdit"
                    :model-value="props.currentValue"
                    @update:model-value="props.updateCurrentValue"
                    @inheritance-restore="props.restoreInheritance"
                    @inheritance-remove="props.removeInheritance"
                />

            </template>
        </sw-inherit-wrapper>
        {% endblock %}

        <sw-extension-teaser-popover
            position-identifier="sw-product-generated-description-button"
        />
    </div>
</div>
{% endblock %}
